#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <iostream>
#include <vector>

// Thread.h:
class Thread {
  public:
    static void*  callMemberFunction(void *arg) { return ((Thread*)arg)->memberFunction(); }
    
    void*         memberFunction(void);
    void          startThread(void);
};

// Thread.cpp:
void* Thread::memberFunction(void) {
  printf("Chuj odpalil\n");
  return 0;
}

void  Thread::startThread(void) {
  pthread_t tid;
  int       result;
  printf("startowanie chuja\n");
  result = pthread_create(&tid, 0, Thread::callMemberFunction, this);
  pthread_join( tid, NULL);
  if (result == 0)
     pthread_detach(tid);
}

main(){
	Thread thr;
	thr.startThread();
	
}
